import Router from 'vue-router'
// import {  setSideBarVisible } from './frame/methods'

function init(Vue) {
  Vue.use(Router)
  const router =  new Router({
    mode: 'history',
    base: `${process.env.VUE_APP_ROUTER_BASE}`,
    routes: [
      // developing页面
      {
        path: '/:moduleName/developing',
        name: 'developing',
        component: () =>
        import(/* webpackChunkName: "project" */ './views/developing.vue'),
      },
      {
        path: '/:moduleName/:subTitleName/developing',
        name: 'developing',
        component: () =>
        import(/* webpackChunkName: "project" */ './views/developing.vue'),
      },
      {
        path: '/payment',
        name: 'payment',
        redirect: '/payment/market-analysis/developing',
        // component: () =>
        // import(/* webpackChunkName: "project" */ './views/developing.vue'),
      },
      {
        path: '/payment/developing',
        name: 'payment',
        component: () =>
        import(/* webpackChunkName: "project" */ './views/developing.vue'),
      },

      // 运营平台
      {
        path: '/operation-analysis',
        redirect: '/operation-analysis/user-views',
      },
      {
        path: '/operation-analysis/user-views',
        name: 'operation-analysis-user-views',
        component: () =>
        import(/* webpackChunkName: "project" */ './views/operation-analysis/index.vue'),
      },
      {
        path: '/operation-analysis/runtime-views',
        name: 'operation-analysis-runtime-views',
        component: () =>
        import(/* webpackChunkName: "project" */ './views/operation-analysis/index.vue'),
      },
      {
        path: '/my/center/info',
        name: '个人信息',
        component: () =>
          import(/* webpackChunkName: "project" */ './views/center/info'),
        meta: {
          pageName: false,
          pageBlank: false,
          contentBg: true
        }
      }
    ]
  })
  return router
}

export default {
  init
}
